<?php
/**用户添加mod**/
include "../sql_mod/sql_config.php";
$db_name = $_POST["name"];
$db_sex = $_POST["sex"];
$db_id_card = $_POST["id_card"];
$db_phone = $_POST["phone"];
$db_user = $_POST["user"];
$db_passwd = $_POST["passwd"];
$db_email = $_POST["email"];
$db_jurisdiction = $_POST["jurisdiction"];

//测试参数
echo "$db_name<br />";
echo "$db_sex<br />";
echo "$db_id_card<br />";
echo "$db_phone<br />";
echo "$db_user<br />";
echo "$db_passwd<br />";
echo "$db_email<br />";
echo "$db_jurisdiction<br />";

$sql = "INSERT INTO `zzhk`.`zzhk_user`(`name`, `sex`, `id_card`, `phone`, `email`, `user`, `passwd`, `jurisdiction`) VALUES ('$db_name', '$db_sex', '$db_id_card', '$db_phone', '$db_email', '$db_user', '$db_passwd', '$db_jurisdiction')";
if (mysqli_query($conn,$sql)){
    echo "<br />添加用户成功！";
    echo "<script>location.href='".$_SERVER["HTTP_REFERER"]."';</script>";
}else{
    echo "<br />添加用户失败！数据库写入错误!";
}
mysqli_close($conn);